<template>
  <div class="film_list">
    <div class="title">近期最受期待</div>
    <MySwiper :preview="4" :height="170" :key="films.length">
      <div class="swiper-slide" v-for="item in films" :key="item.filmId">
        <img style="width: 85px; height: 115px" :src="item.poster" />
        <div class="name">{{ item.name }}</div>
        <div class="date">12月18日</div>
      </div>
    </MySwiper>
  </div>
</template>

<script>
import MySwiper from "../components/MySwiper";

export default {
  data() {
    return {
      films: [],
    };
  },
  components: {
    MySwiper,
  },
  async mounted() {
    let ret = await this.$api.getComingFilmList({ cityId: 110100 });
    // console.log(ret)
    this.films = ret.data.films;
  },
};
</script>
<style lang='scss' scoped>
.film_list {
  width: 100%;
  background: #f5f5f5;
  .title {
    font-size: 14px;
    color: #333;
    padding-top: 12px;
    padding-bottom: 12px;
    text-indent: 10px;
  }
  .swiper-slide {
    margin-left: 10px;
    .name {
      font-size: 13px;
      font-weight: bold;
      color: #222;
      margin-bottom: 3px;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
    .date {
      font-size: 12px;
      color: #999;
    }
  }
}
</style>
